<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
class WxPayNotify extends WxPayNotifyReply
{
    public final function Handle($needSign = true)
    {
        file_put_contents("./weixinQuery.txt", 0, FILE_APPEND);
        $msg = "OK";
        $result = WxpayApi::notify([$this, "NotifyCallBack"], $msg);
        if(!$result) {
            file_put_contents("./weixinQuery.txt", "false", FILE_APPEND);
            $this->SetReturn_code("FAIL");
            $this->SetReturn_msg($msg);
            $this->ReplyNotify(false);
        } else {
            file_put_contents("./weixinQuery.txt", "true", FILE_APPEND);
            $this->SetReturn_code("SUCCESS");
            $this->SetReturn_msg("OK");
            $this->ReplyNotify($needSign);
        }
    }
    public function NotifyProcess($data, &$msg)
    {
        return true;
    }
    public final function NotifyCallBack($data)
    {
        $msg = "OK";
        $aaa = json_encode($data);
        file_put_contents("./weixinQuery.txt", "NotifyCallBack:data---:" . $aaa, FILE_APPEND);
        $result = $this->NotifyProcess($data, $msg);
        file_put_contents("./weixinQuery.txt", "NotifyProcess:data---:" . $result, FILE_APPEND);
        if($result) {
            $this->SetReturn_code("SUCCESS");
            $this->SetReturn_msg("OK");
        } else {
            $this->SetReturn_code("FAIL");
            $this->SetReturn_msg($msg);
        }
        return $result;
    }
    private final function ReplyNotify($needSign = true)
    {
        if($needSign && $this->GetReturn_code($return_code) == "SUCCESS") {
            $this->SetSign();
        }
        WxpayApi::replyNotify($this->ToXml());
    }
}

?>